package com.geetour.columbus.region.bo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.geetour.columbus.common.exceptions.BOException;
import com.geetour.columbus.common.model.D.City;
import com.geetour.columbus.common.model.D.District;
import com.geetour.columbus.common.model.D.Province;
import com.geetour.columbus.region.bo.IRegionDictBO;
import com.geetour.columbus.region.dao.IRegionDictDAO;

@Service
public class RegionDictBOImpl implements IRegionDictBO {
    
    private IRegionDictDAO regionDictDAOImpl;

    @Autowired
    public void setRegionDictDAOImpl(IRegionDictDAO regionDictDAOImpl) {
        this.regionDictDAOImpl = regionDictDAOImpl;
    }

    @Override
    public List<Province> getAllProvinces() throws BOException {
        return regionDictDAOImpl.findAllProvinces();
    }

    @Override
    public List<City> getCitysByProvinceId(Long id) throws BOException {
        return regionDictDAOImpl.findCitysByProvinceId(id);
    }

    @Override
    public List<District> getDistrictsByCityId(Long id) throws BOException {
        return regionDictDAOImpl.findDistrictsByCityId(id);
    }

}
